package com.javapda.c328r.command.impl;

import org.apache.commons.lang.builder.ToStringBuilder;


/**
 * 
 * 
 */
public class SetPackageSizeComediaCommand extends AbstractComediaCommand {
	private transient String toString;

	public String toString() {
		if (toString == null) {
			toString = new ToStringBuilder(this)
							.append("Package Size Low Byte", getPackageSizeLowByte())
							.append("Package Size High Byte", getPackageSizeHighByte())
							.append("Package Size Hex", getPackageSizeHex())
							.toString();
		}
		return toString;
	}
	private String getPackageSizeHex() {
		StringBuilder sb = new StringBuilder();
		sb.append(Integer.toHexString(getPackageSizeHighByte()));
		sb.append(Integer.toHexString(getPackageSizeLowByte()));
		return sb.toString();
	}
	public SetPackageSizeComediaCommand() {
		super(new SetPackageSizeComediaCommandId());
		setParameter1(0x08);  // hard-coded, always 0x08
	}
	public SetPackageSizeComediaCommand(int[] spsInfo) {
		this();
		setPackageSizeLowByte(spsInfo[3]);
		setPackageSizeHighByte(spsInfo[4]);
	}
	public void setPackageSizeLowByte(int lowByte) {
		setParameter2(lowByte);
	}
	public int getPackageSizeLowByte() {
		return getParameter2();
	}
	public void setPackageSizeHighByte(int highByte) {
		setParameter3(highByte);
	}
	public int getPackageSizeHighByte() {
		return getParameter3();
	}
	
	

}
